#include <stdio.h>
#include <Windows.h>

int main()
{
	DWORD start = GetTickCount();
	freopen("test.in", "r", stdin);
	freopen("test.out", "w", stdout);
	
	int m = 0, n = 0;
	int n10 = 0, n5 = 0, n3 = 0, n1 = 0;
	scanf("%d %d", &m, &n);
	int left = m - n;
	n10 = left / 10;
	for ( ; n10 >= 0; n10 -- ) 
	{
		n5 = ( left - n10 * 10) / 5;
		for ( ; n5 >= 0; n5-- ) 
		{
			n3 = ( left - n10 * 10 - n5 * 5) / 3;
			for ( ; n3 >=0; n3 -- ) 
			{
				n1 = ( left - n10 * 10 - n5 * 5 - n3 * 3);
				printf("%d %d %d %d\n", n10, n5, n3, n1);
			}
		}
	}
	
	DWORD time = GetTickCount() - start;
	printf("\ntime = %.2f\n", (1000.0 * time) / 905 );
	fclose(stdin);
	fclose(stdout);
	return 0;
}
